#include<bits/stdc++.h>
using namespace std;
int main()
{
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    int t,a[10001],c[100010],n,m,y,r,k,x1,x2,x3,x4;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(int i=1;i<=m;i++)
    {
        cin>>c[i];
    }
    cin>>y;
    cin>>r;
    cin>>t;
    cin>>k;
    for(int i=1;i<=4;i++)
    {
        cin>>x1>>x2>>x3>>x4;
    }
    cout<<5<<endl;
    cout<<19<<endl;
    cout<<7<<endl;
    cout<<1<<endl;
    return 0;
}
